/**
 * Copyright (C) 2012 Oleg Anastassov <o.anastasov@gmail.com>
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package kz.kstu.ent.business.entity;

import javax.persistence.*;

/**
 * Date: 29.08.12
 * Time: 20:20
 *
 * @author Oleg Anastassov
 */
@Entity
@Table(name = "RESULT_SHEET")
@NamedQueries({
        @NamedQuery(name = QueryNames.RESULT_SHEET_FIND_BY_EXAM_ID, query =
                "SELECT RS " +
                        "FROM ResultSheet RS " +
                        "WHERE RS.exam.id = :examId "
        )
})
public class ResultSheet implements Identifiable {

    private Long id;

    private Student student;

    private Exam exam;

    private Integer math;

    private Integer kazakh;

    private Integer russian;

    private Integer kazakhHistory;

    private Subject subject;

    private Integer subjectResult;

    public ResultSheet() {
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "STUDENT_ID", referencedColumnName = "ID", nullable = false)
    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    @ManyToOne
    @JoinColumn(name = "EXAM_ID", referencedColumnName = "ID", nullable = false)
    public Exam getExam() {
        return exam;
    }

    public void setExam(Exam exam) {
        this.exam = exam;
    }

    @Column(name = "MATH")
    public Integer getMath() {
        return math;
    }

    public void setMath(Integer math) {
        this.math = math;
    }

    @Column(name = "KAZAKH")
    public Integer getKazakh() {
        return kazakh;
    }

    public void setKazakh(Integer kazakh) {
        this.kazakh = kazakh;
    }

    @Column(name = "RUSSIAN")
    public Integer getRussian() {
        return russian;
    }

    public void setRussian(Integer russian) {
        this.russian = russian;
    }

    @Column(name = "KAZAKH_HISTORY")
    public Integer getKazakhHistory() {
        return kazakhHistory;
    }

    public void setKazakhHistory(Integer kazakhHistory) {
        this.kazakhHistory = kazakhHistory;
    }

    @ManyToOne
    @JoinColumn(name = "SUBJECT_ID", referencedColumnName = "ID", nullable = false)
    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }

    @Column(name = "SUBJECT_RESULT")
    public Integer getSubjectResult() {
        return subjectResult;
    }

    public void setSubjectResult(Integer subjectResult) {
        this.subjectResult = subjectResult;
    }

}
